import { Alova } from '@/utils/http/alova/index';

// 站场信息数据结构
interface StationInfo {
  centerLatitude: number;
  centerLongitude: number;
  createId: string;
  createName: string;
  createTime: string;
  direction: string;
  directionEast: string;
  directionNorth: string;
  directionSouth: string;
  directionWest: string;
  fileName: string;
  filePath: string;
  mapRotate: number;
  mapZoom: number;
  offlineFilePath: string;
  offlineZipfile: string;
  offlineZoom: number;
  orgArray: string;
  orgArrayName: string;
  orgId: string;
  orgName: string;
  remark: string;
  spanner: number;
  stationAddress: string;
  stationCharge: string;
  stationCode: string;
  stationId: string;
  stationName: string;
  stationTelephone: string;
  updateId: string;
  updateName: string;
  updateTime: string;
  directionName: string;
}

const baseApi = '/web/proj/station';

/**
 * 根据ID获取站场信息
 */
export function getStationById(params: any) {
  return Alova.Post<InResult<StationInfo>>(baseApi + '/byId', { params });
}


/**
 * 
 */
export function getStationByOrgId(params: any){
  return Alova.Post<InResult<StationInfo>>(baseApi + '/byOrgId', { params });
}

/**
 * 添加站场
 */
export function addStation(params: Partial<StationInfo>) {
  return Alova.Post<InResult<StationInfo>>(baseApi + '/addRecord', { params });
}

/**
 * 更新站场信息
 */
export function updateStation(params: Partial<StationInfo> & { stationId: string }) {
  return Alova.Post<InResult<StationInfo>>(baseApi + '/updateRecord', { params });
}

/**
 * 删除站场
 */
export function deleteStation(params: { stationId: string }) {
  return Alova.Post<InResult<boolean>>(baseApi + '/deleteRecord', params);
}
